<template>
    <div class="right-container">
        <h3>Right 组件</h3>
        <button @click="PostInfo">发起 POST 请求</button>
        <button @click="btnGetBooks">获取图书列表的数据</button>
    </div>
</template>

<script>
    export default {
        methods: {
            async PostInfo() {
                let res = await this.$http.post('/api/post', {name: 'zs', age: 20})
                console.log(res)
            },
            async btnGetBooks() {
                const {data: res} = await this.$http.get('/api/getbooks')
                console.log(res)
            }
        }
    }
</script>

<style>
.right-container {
    background-color: skyblue;
    min-height: 200px;
    flex: 1;
}
</style>